SQL - OCR Computer Science A Level

Description

A level Computer Science (Databases and SQL) Flashcards on SQL - OCR Computer Science A Level, created by Malachy Moran-Tun on 18/05/2022.
Malachy Moran-Tun
Flashcards by Malachy Moran-Tun, updated more than 1 year ago More Less
Malachy Moran-Tun
Created by Malachy Moran-Tun almost 2 years ago
Malachy Moran-Tun
Copied by Malachy Moran-Tun almost 2 years ago
0
0

Resource summary

Question Answer
What is SQL? > Structured Query Language > Declaritave language used for updating tables in a relational database > Uses statements to make, query, and modify databases
What do the Following Commands do? > SELECT > FROM > WHERE > ORDER BY > SELECT - lists the fields to be displayed > FROM - lists the table(s) where data will be read from > WHERE - lists data that matches the criteria > ORDER BY - orders the results (default is ascending order)
How does the LIKE Command Work? > Condition that finds values with a wildcard > LIKE "a%" finds values that begin with a > LIKE "%a" finds values that end with a > LIKE "%a%" finds values with a in any position > LIKE "_a%" finds values with a in second position (more underscores = higher position) > LIKE "a%b" finds values that begin with a and and with b
What does the JOIN Command do? > Combines rows from two or more tables, based on a common field between them
How does the CREATE TABLE Command Work? CREATE TABLE table_name ( Attribute1 DATA_TYPE, PRIMARY KEY Attribute2 DATA_TYPE etc. ) For linked tables: FOREIGN KEY Attribute3 REFERENCES OtherTable(Attribute3)
What Data Types can be used when Creating a Table? > CHAR(n) - string of fixed length n > VARCHAR(n) - string of variable length, max n > BOOLEAN - true or false, i mean you should know that one > INTEGER / INT - ... an integer, what did you expect? > FLOAT - a decimal (real) number > DATE - a... a date. y'know, day, month year > TIME - like hours, minutes, and seconds... it's pretty self explanatory > CURRENCY - le cash money
How does the ALTER TABLE Command Work? > Used to add, delete, or modify columns > ALTER TABLE table_name ADD attribute_name - adds the specified attribute > ALTER TABLE table_name DROP COLUMN attribute_name - removes the specified attribute > ALTER TABLE table_name MODIFY COLUMN attribute_name DATA_TYPE - changes the data type of the attribute
How does the INSERT INTO Command Work? > Used to insert a new record into a table INSERT INTO table_name (column1, column2...) VALUES (value1, value2...) > If attributes are unknown, do not list them in the columns or values
How does the UPDATE Command Work? > Used to update a record in a database table UPDATE table_name SET column1 = value1, etc. WHERE attribute = value
How does the DELETE Command Work? > it deletes a record. who'd've thunk it? DELETE FROM table_name WHERE attribute = value
Show full summary Hide full summary

Similar

Computing Hardware - CPU and Memory
ollietablet123
SFDC App Builder 2
Parker Webb-Mitchell
Data Types
Jacob Sedore
Intake7 BIM L1
Stanley Chia
Software Processes
Nurul Aiman Abdu
Design Patterns
Erica Solum
CCNA Answers – CCNA Exam
Abdul Demir
Abstraction
Shannon Anderson-Rush
Spyware
Sam2
HTTPS explained with Carrier Pigeons
Shannon Anderson-Rush
Data Analytics
anelvr