Presentation is loading. Please wait.

Presentation is loading. Please wait.

Databases.  Question 1: What does SQL stand for? …………………………………………………………………… (1 point)  Question 2: Considering programming paradigms, what kind of language.

Similar presentations


Presentation on theme: "Databases.  Question 1: What does SQL stand for? …………………………………………………………………… (1 point)  Question 2: Considering programming paradigms, what kind of language."— Presentation transcript:

1 Databases

2  Question 1: What does SQL stand for? …………………………………………………………………… (1 point)  Question 2: Considering programming paradigms, what kind of language is SQL? …………………………………………………………………… (1 point)  Question 3: Explain what purpose you would use SQL Language for. …………………………………………………………………… …………………………………………………………………… (2 points)

3  Question 4 a) What is the purpose of a primary key? …………………………………………………………………… (1 point)  Question 4 b) What is the purpose of a foreign key? …………………………………………………………………… (1 point)  Question 4 c) What is the term used for the act of splitting out data within a database using these keys? …………………………………………………………………… (1 point)

4  Question 5: You are designing an application for a music company that sells music downloads online. Within their business design the company asks you to design the website which will sell these downloads. You will be working on the principal that the company sells multiple tracks which may also be sold as albums from a variety of artists.  A): How would you complete the following ERD? (1 point) TrackAlbum

5  B): How would you complete the following DFD? (3 points) Customer Download

6  C) Explain Third Normal Form. …………………………………………………………………… …………………………………………………………………… (2 points)  D) Your database will include tables named tbl_tracks, tbl_albums and tbl_artists. How would you split your fields between these to ensure the application meets 3NF? (3 points) tbl_trackstbl_albumstbl_artists

7  E) You are required to add a new record to tbl_albums. Complete the SQL statement below: ……………………………….tbl_albums …………………(………………………………………………..) (2 points)  F) You are required to update an existing record in tbl_artists. Complete the SQL statement below: …………………..tbl_artists …………..(……………………………………………………...) ……………………………………………………………………. (3 points)  G) You are required to output all records in tbl_albums that begin with ‘B’. Complete the SQL statement below: ……………………… …………………….tbl_albums ……………………………………………………………………. (2 points)

8  H) You are required to output all records in tbl_tracks in alphabetical order. Complete the SQL statement below ……………………… …………………….tbl_tracks ……………………………………………………………………. (3 points)  I) You are required to output the number of records output in the statement above. Complete the SQL statement below: ……………………………………………………….…………… …………………….tbl_tracks (2 points)  J) You are required to output all records in tbl_tracks grouped by their album. Complete the SQL statement below: ……………………… …………………….tbl_tracks …………………………………………………………… (2 points)

9  E) You are required to add a new record to tbl_albums. Complete the SQL statement below: INSERT INTO tbl_albums (AlbumName, ArtistId, Price) VALUES (“American Idiot”, 22, 7.99) (2 points)  F) You are required to update an existing record in tbl_artists. Complete the SQL statement below: UPDATE tbl_artists SET (ArtistName = “Green Day”, Genre = “Punk”) WHERE ArtistId = 22 (3 points)  G) You are required to output all records in tbl_albums that begin with ‘B’. Complete the SQL statement below: SELECT * FROM tbl_albums WHERE AlbumName LIKE ‘B%’ (2 points)

10  H) You are required to output all records in tbl_tracks in alphabetical order. Complete the SQL statement below SELECT * FROM tbl_tracks ORDER BY trackName (2 points)  I) You are required to output the number of records output in the statement above. Complete the SQL statement below: SELECT (COUNT trackName) FROM tbl_tracks (2 points)  J) You are required to output all records in tbl_tracks grouped by their album. Complete the SQL statement below: SELECT * FROM tbl_tracks GROUP BY albumId (2 points)


Download ppt "Databases.  Question 1: What does SQL stand for? …………………………………………………………………… (1 point)  Question 2: Considering programming paradigms, what kind of language."

Similar presentations


Ads by Google