Section 1

Preview this deck

how do you select all the records from a table named "Persons" where the "LastName" is alphabetically between (and including) "Hansen" and "Pettersen"?

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (17)

Section 1

(17 cards)

how do you select all the records from a table named "Persons" where the "LastName" is alphabetically between (and including) "Hansen" and "Pettersen"?

Front

SELECT * FROM Persons WHERE LastName BETWEEN 'Hansen' AND 'Pettersen'

Back

how can you insert a new record into the "Persons" table?

Front

INSERT INTO Persons VALUES ('Jimmy', 'Jackson')

Back

How to put data in asc or desc order

Front

select * from table ORDERBY column name ; select * from table ORDERBY column name DESC;

Back

With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" is "Peter"?

Front

SELECT * FROM Persons WHERE FirstName='Peter'

Back

Use an SQL function to select the record with the highest value of the Price column. (table named products)

Front

SELECT MAX(Price) FROM product

Back

how can you return all the records from a table named "Persons" sorted descending by "FirstName"?

Front

SELECT * FROM Persons ORDER BY FirstName DESC

Back

Use an SQL function to calculate the average price of all products (table named products)

Front

SELECT AVG(Price) FROM Products;

Back

how do you select all the records from a table named "Persons" where the "FirstName" is "Peter" and the "LastName" is "Jackson"?

Front

SELECT * FROM Persons WHERE FirstName='Peter' AND LastName='Jackson'

Back

How can you change "Hansen" into "Nilsen" in the "LastName" column in the Persons table?

Front

UPDATE Persons SET LastName='Nilsen' WHERE LastName='Hansen'

Back

Use an SQL function to calculate the sum of all the Price column values in the Products table (table named products)

Front

SELECT SUM(Price) FROM Products;

Back

how do you select all the records from a table named "Persons" where the value of the column "FirstName" starts with an "a"?

Front

SELECT * FROM Persons WHERE FirstName LIKE 'a%'

Back

how can you insert "Olsen" as the "LastName" in the "Persons" table?

Front

INSERT INTO Persons (LastName) VALUES ('Olsen')

Back

How to select NULL values from table selecting 2 columns

Front

select column1,column 2 FROM table WHERE column 2 IS NULL

Back

, how can you return the number of records in the "Persons" table?

Front

SELECT COUNT(*) FROM Persons

Back

Use the MIN function to select the record with the smallest value of the Price column. (table named products)

Front

SELECT MIN(Price) FROM Products;

Back

Use the correct function to return the numbers of records that have the Price value set to 18 (table names products)

Front

SELECT count (*) FROM Products where Price = 18;

Back

Use the correct function to return the numbers of records that have the Price value set to 18 (table named products)

Front

SELECT COUNT (*) FROM Product WHERE Price =18;

Back