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:
Comments (Atom)
This is an example of scrolling text using Javascript.
Popular Posts
-
//sample solution // Card Constructor function Card(num1,num2) { //properties var suit = num1; var number = num2; //methods ...
-
Find an expression using two values and the modulus operator that results as 4 Answer: 32%7
-
Question: The total power dissipation in an RL series circuit is due to which component? Answer: The total power dissipation is due to ...
-
Question: How much internal resistance does an ideal current source have? Answer: An ideal current source has infinite resistance.
-
function spinalCase(str) { var str2 = str.replace(/([a-z](?=[A-Z]))/g,'$1 '); var newStr = str2.replace(/\s|\x5F/g,"-...
-
// What's an API key? // A: An alphanumeric string used to identify you to an API // B: An OAuth token // C: An All-Purpose Interne...
-
// Sample solution to style.css html, body { /* The universe takes up all available space */ width: 100%; height: 100%; ...
-
function steamrollArray(arr) { // I'm a steamroller, baby var flattened = arr.reduce( function(a, b) { return a.conca...
-
Question: When is the maximum power delivered from a practical source to a load? Answer: Maximum power is delivered to the load when it...
-
//sample solution NSNumber *age = @10; Back to the list of sample solutions for Try Objective C: Level 1 challenges