Quotes help make search much faster. Example: "Practice Makes Perfect"
Wednesday, September 4, 2013
SQL Problem: Select all columns for everyone whose last name ends in "ith".
Solution:
SELECT * FROM employee WHERE last LIKE '%ith';
SQL Problem: Select all columns for everyone over 80 years old.
Solution:
SELECT * FROM employee WHERE age > 80;
SQL Problem: Select the first name for everyone whose first name equals "Potsy".
Solution:
SELECT first FROM employee WHERE first = 'Potsy';
SQL Problem: Select all columns for everyone whose last name contains "ebe".
Solution:
SELECT * FROM employee WHERE last LIKE '%ebe%';
SQL Problem: Select first name, last name, and salary for anyone with "Programmer" in their title.
Solution:
SELECT first, last, salary FROM employee WHERE title = 'Programmer';
SQL Problem: Select first and last names for everyone that's under 30 years old.
Solution:
SELECT first, last FROM employee WHERE age < 30;
SQL Problem: Select all columns for everyone with a salary over 30000.
Solution:
SELECT * FROM employee WHERE salary > 30000;
SQL Problem: Select all columns for everyone in your employee table.
Solution:
SELECT * FROM employee;
SQL Insert Problem
Problem:
Enter these employees into your table
Jonie Weber, Secretary, 28, 19500.00
Potsy Weber, Programmer, 32, 45300.00
Dirk Smith, Programmer II, 45, 75020.00
Solution:
insert into employee
(first, last, title, age, salary)
values ('Jonie', 'Weber', 'Secretary', 28, 19500.00);
insert into employee
(first, last, title, age, salary)
values ('Potsy', 'Weber', 'Programmer', 32, 45300.00);
insert into employee
(first, last, title, age, salary)
values ('Dirk', 'Smith', 'Programmer II', 45, 75020.00);
SQL Create Table Problem
Problem:
Create a table that will contain the following information about your new employees: firstname, lastname, title, age, and salary.
Solution:
create table employee
(first varchar(20),
last varchar(20),
title varchar(20),
age number(3),
salary number(10));
SQL Problem: Display all columns for everyone whose first name contains "Mary".
Solution:
SELECT * FROM table_name WHERE first_name LIKE '%Mary%';
SQL Problem: Display all columns for everyone whose first name equals "Mary".
Solution:
SELECT * FROM table_name WHERE first = 'Mary';
SQL Problem: Display the first and last names for everyone whose last name ends in an "ay".
Solution:
SELECT first, last FROM table_name WHERE last LIKE '%ay';
SQL Problem: Display all columns for everyone that is over 40 years old.
Solution:
SELECT * FROM table_name WHERE age > 40;
SQL Problem: Display the first name, last name, and city for everyone that's not from New York.
Solution:
SELECT first_name, last_name, city FROM table_name WHERE city <> 'New York';
SQL Problem: Display the first name and age for everyone that's in the table
Solution:
SELECT first_name, age, FROM table_name;
Subscribe to:
Posts (Atom)
This is an example of scrolling text using Javascript.
Popular Posts
-
var my_canvas=document.getElementById('canvas'); var context=my_canvas.getContext('2d');
-
This is caused by the entrance of water into the air sacs which makes the lungs doughy, readily pits on pressure, exuding water and froth
-
Question: What current is required for full scale deflection of a galvanometer having a current sensitivity of 50 micro-amperes per scale di...
-
#sample solution print "What's your first name?" first_name = gets.chomp.capitalize! print "What's your last na...
-
//Sample Solution const gameState = {} function preload() { this.load.image('codey', 'https://s3.amazonaws.com/codecademy-...
-
#Sample Solution --- title: "Data Cleaning in R" output: html_notebook --- ```{r message=FALSE, warning=FALSE} # load libra...
-
Solution: SELECT first_name, age, FROM table_name;
-
# Update data types year_1_str = str(year_1) revenue_1_str = str(revenue_1) # Create a complete sentence combining only the string d...
-
#sample solution secret_identities = { "The Batman" => "Bruce Wayne", "Superman" => "Clark Ke...
-
Answer: This is the type of injury when a blow to the forehead causes a contusion of the eyeball due to the fracture of the bone at the r...