logo

COVER PAGE. Task 1. My Database select queries . Write

   

Added on  2023-04-08

7 Pages401 Words297 Views
COVER PAGE

Task 1
My Database select queries
Write a query that uses an aggregate function.
select count(customerid) from customer;

Write a query that retrieves data from at least two of your tables.
select customer.*, address.* from customer,address where
customer.customerid=address.customerid;
Write a query that has a primary and secondary sort. One of the sorts must be in the reverse
order.
select customer.*, address.* from customer,address where
customer.customerid=address.customerid
order by customer.firstname desc,address.street;

Write a query that implements a wildcard search.
select * from customer where lastname like '%n%';
Write a query that uses a mathematical calculation to on two or more columns and uses a
column alias on the calculation.
select max(customerid)-min(customerid) as "Difference between the first and last
customerid" from customer;

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
INTRODUCTION TO DATABASE l ASSIGNMENT
|5
|301
|31

SQL queries for creating and manipulating tables in a database
|12
|1173
|184

Database Implementation Report for CQUnited Property Management System
|8
|932
|250

Database Creation and Management for PartyKids
|26
|1726
|365

Database Management System
|16
|590
|69

SQL Final Exam
|3
|777
|265