Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. (3 pts) Write a SQL command that will create a table named scores that has the fields studentsName (string 30 characters), score (integer) and

1. (3 pts) Write a SQL command that will create a table named scores that has the fields studentsName (string 30 characters), score (integer) and maxScore (integer).

2. (3 pts) Write a SQL command that will insert a record into the scores table above for a student whose name is Kyle, with a score of 80, in a test with a maximum score of 200.

3. (3 pts) Write a SQL command that will display the name and score (not maxScore) of students where the maximum score of the test is 200.

4. (3 pts) Write a SQL command that will create a table named appts that has the fields student (string 14 characters), advisor (string 3 characters), and room (integer).

5. (3 pts) Write a SQL command that will insert a record into the appts table above for a student named Kelly, where the advisor is JSR, and the room number is 5.

6. (3 pts) Write a SQL command that will display the name of students that are associated with the advisor named JSR.

7. (7 pts) Use the FRIENDS table to answer the following questions.

LASTNAME FIRSTNAME AREACODE PHONE ST ZIP

--------------- ---------------- -------- -------- -- ------

BUNDY AL 100 555-1111 IL 22333

MEZA AL 200 555-2222 UK

MERRICK BUD 300 555-6666 CO 80212

MAST JD 381 555-6767 LA 23456

BULHER FERRIS 345 555-3223 IL 23332

PERKINS ALTON 911 555-3116 CA 95633

BOSS SIR 204 555-2345 CT 95633

a. Write a query that returns everyone in the database whose last name begins with M.

b. Write a query that returns everyone who lives in Illinois with a first name of AL.

c. Given two tables (PART1 and PART2) containing columns named PARTNO, how would you find out which part numbers are in both tables? Write the query.

Use the INTERSECT. Remember that INTERSECT returns rows common to both queries.

d. What shorthand could you use instead of WHERE a >= 10 AND a <=30?

e. What will this query return?

SELECT FIRSTNAME

FROM FRIENDS

WHERE FIRSTNAME = 'AL'

AND LASTNAME = 'BULHER';

f. Using the FRIENDS table, write a query that returns the following:

NAME ST

------------------- --

AL IL

g. Using the FRIENDS table, write a query that returns the following:

NAME PHONE

-------------------------- ------------

MERRICK, BUD 300-555-6666

MAST, JD 381-555-6767

BULHER, FERRIS 345-555-3223

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Visual Basic 2005 For Windows Mobile Web Office And Database Applications Comprehensive

Authors: Gary B. Shelly, Thomas J. Cashman, Corinne Hoisington

1st Edition

0619254823, 978-0619254827

More Books

Students also viewed these Databases questions

Question

1. Identify three approaches to culture.

Answered: 1 week ago

Question

2. Define communication.

Answered: 1 week ago

Question

4. Describe how cultural values influence communication.

Answered: 1 week ago