Fichas
130 SQL Revision
Fichas del conjunto (38)
- 1DatabaseOrganized collection of data for one or more purposes. Usually in a digital format. Who needs paper back databases. We're not in the Stone age. iStone 4s
- 2Data StructureHow information is structured in a database
- 3Data ManipulationMethods which data can be operated on.
- 4Data IntegrityMethods to enforce relationships within and between tables.
- 5Data IntegrityControls what can and cannot be done in a database.
- 6Domain IntegrityRestricts values in columns.
- 7Entity IntegrityControls rows in tables. For example; no two rows cannot be equal.
- 8Referential IntegrityMaintains relationships between tables.
- 9KeysRepresent an attribute that can be used to sort or uniquely identify tuples in a relation
- 10Primary KeyUniquely identify tuples in a relation
- 11Foreign KeyCross-reference data between relations.
- 12Candidate KeyFor any tuple in the relation, you need to have values in which uniquely identify that tuple.
- 13Properties of a Primary KeyCannot be Null
Has to be Unique
Each relation must have a primary key
Using a primary Key ensures entity Integrity - 14Properties of a Foreign KeyA key which identifies a key in another table is called the parent key
- 15INSERTAdding rows into a table
INSERT INTO cunts VALUES (69, "Alex", "Stout"); - 16WHEREConditional clause. Allows us to choose from specific values in a table
- 17UPDATEWhere you want to change a specific field with in a table.
- 18DELETEDeleting records or fields based on the condition(if any).
- 19SELECTCan retrieve results from a table in a database
- 20SELECT *Selecting all records within a specific table
- 21SELECT DISTINCTWill remove any duplicates in the records in which you are trying to return
- 22INExplicitly allows values with in a table.
SELECT name FROM emp WHERE city IN "Manchester"; - 23BETWEENDefined a range of values in which are defined.
BETWEEN (lowestValue) AND (highestValue); - 24LIKEAllows a search in pattern for the operator
WHERE city LIKE "Man%" - 25ANDIn order for something to return true, all conditions in which are specified must return true
- 26ORIn order for something to return true, any conditions in which are specified must return true.
- 27ORDER BYOrdering returned values in a specific Order
ASC = Lowest > Highest
DESC = Highest > Lowest - 28LIMITLimiting how many results you want to return on your statement.
- 29GROUP BYLets you use aggregate functions on a specific row/coloumn
- 30Cartesian ProductReturns all possible values. SELECT *
This isn't good btw. - 31INNER JOINSIs a Cartesian product with a condition.
Combining two tables, returning only the rows which satisfy some condition - 32Natural JoinsCan be used if the two attributes of the join condition have the same name
- 33LEFT (OUTER) JOINUsing an inner join means some tuples are lost. Consider joining Tables A, B. Left join retains all the lost records of A
- 34RIGHT (OUTER) JOINRetains all the records for B
- 35FULL (OUTER) JOINRetains all possible records
- 36UNIONCombines the result set of two or more select statements
- 37IntersectionThe intersection of two sets; A, B. Will only return values which have the same values in each set
- 38EXCEPTWhen you want to find all the values in one set that does not appear in another
Información
- Descripción
- SCC 130 Information Systems Revision SQL
- Creado por
- Shez F
- Visitas
- 5
- Etiquetas
- Valoración