Create Tables Instructions

create_tables_instructions

User Manual:

Open the PDF directly: View PDF PDF.
Page Count: 3

DownloadCreate Tables Instructions
Open PDF In BrowserView PDF
LON

COMMNT (0)

QL > Dataase Manipulation

Create Tales
We'll make some tales using QL CRAT TAL statements. We recommend writing our
QL in some le just to make it eas to save and edit. You can then cop and paste from
this le into our sqlite shell to execute the commands.
elow are the three tales we need. After looking at the linked guide aove, attempt to
write the code ourself and then open the hint and compare the answer to our code.
Add the following attriutes to the movie tale.
• id
• tpe INTGR
• primar ke
• name
• tpe TXT
• default value NULL
• ear
• tpe INTGR
• default value NULL
• rank
• tpe RAL
• default value NULL
Hint: CRAT movies

CRAT TAL movie (
id INTGR PRIMARY KY,
name TXT DFAULT NULL,
ear INTGR DFAULT NULL,

rank RAL DFAULT NULL
);

Click to toggle hint



WARNING: Primar ke columns onl auto-increment properl if the are of tpe INTGR .

nonms such as INT cause such columns to ehave as normal data elds - reference.
Add the following attriutes to the actor tale.
• id
• tpe INTGR
• primar ke
• rst_name
• tpe TXT
• default value NULL
• last_name
• tpe TXT
• default value NULL
• gender
• tpe TXT
• default value NULL
Hint: CRAT actors

Click to toggle hint



Click to toggle hint



Add the following attriutes to the role tale.
• actor_id
• tpe INTGR
• movie_id
• tpe INTGR
• role_name
• tpe TXT
• DFAULT value NULL
Hint: CRAT roles

NOT: QLite's CRAT TAL command de nition is similar, ut not the same, as the
Postgres CRAT TAL . Once ou learn the concept however, ou won't have troule
learning the nuances of the Postgres CRAT TAL command either.

PREVIOUS LESSON
Get tarted: et Up a Dataase

NEXT LESSON
eed the Dataase



Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.4
Linearized                      : No
Page Count                      : 3
Creator                         : Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36
Producer                        : Skia/PDF m66
Create Date                     : 2018:06:04 20:26:44+00:00
Modify Date                     : 2018:06:04 20:26:44+00:00
EXIF Metadata provided by EXIF.tools

Navigation menu