Flashcards
SQL
Cards in this deck (20)
- 1what is sqla common query language for all databases
- 2what does sql allow?it allows data to be queried,
it allows data to be manipulated
it allows data to be defined
it allows control of data access - 3what are the 10 commands for SQL, to be familiar withSELECT, FROM, WHERE, LIKE, OR, DELETE, INSERT, DROP, JOIN, AND, UPDATE
- 4How to SELECTSELECT (insert field) FROM (insert table name) WHERE (reference field) = (reference record )
the field name in brackets in the select basically refers to the element of that field
*REMEMBER BRACKETS ARE JUST FOR THIS EXAMPLE, DONT USE IN REAL THING - 5how to select all fields in one goinstead of doing SELECT(all the fields in comas,,) FROM (Table) WHERE (reference
field) = ...
you can just do SELECT * FROM (table) WHERE (reference field ) = ...
(use asterisks instead of all field names)
*REMEMBER BRACKETS ARE JUST FOR THIS EXAMPLE, DONT USE IN REAL THING - 6how to use LIKESELECT (name of field) FROM (table name) WHERE (reference field) is LIKE (alphabetic condition) AND (another condition that meets BOTH conditions)
*REMEMBER BRACKETS ARE JUST FOR THIS EXAMPLE, DONT USE IN REAL THING - 7what is ORDER BYa command that orders outputted listed in whatever way wanted.
ORDER BY (field name) ASC
ASC is ascending order either alphabetically of numerically depending on field
*REMEMBER BRACKETS ARE JUST FOR THIS EXAMPLE, DONT USE IN REAL THING - 8using ORSELECT (field name) FROM (table name) WHERE (reference field) LIKE (condition) OR (reference field) LIKE ..
*REMEMBER BRACKETS ARE JUST FOR THIS EXAMPLE, DONT USE IN REAL THING - 9What is using nested SELECTION?It is selecting something with reference to another SELECTION that is INSIDE brackets
- 10How to use Nested SELECTIONSELECT (field name) FROM (table name) WHERE (Reference field) >
(SELECT (field name) FROM (table name) WHERE (reference field)=whatever needed)
START BY RESOLVING BRACKETS FIRST - 11INSERTING DATA, what is it?inputting new data into the table in the elements in the field. You're referring to the fields when doing this.
- 12How to InsertINSERT INTO (, , )
VALUES (, , ...)
basically, do INSERT INTO whichever table then the field names in (<..>) space , then underneath write VALUES, then in (<..>) write the values in the order of the respective fields
REMEMBER, DONT USE <> SIGN, ITS JUST FOR EXAMPLE, JUST SEPERATE USING commas and enclose with BRACKETS - 13what to remember when inserting stringsREMEMBER TO USE QUOTATION MARKS AROUND IT
- 14DELETE function, what is it?its a function that will delete elements that match condition for deletion
- 15how to use DELETE functionDELETE FROM
WHERE =
use "" for strings
dont use <> its just for example here - 16what is UPDATE functionis allows you to update or modify what is already in the elements
- 17How to use UPDATE commandUPDATE world
SET = , =
WHERE = ...condition
remember strings in "" - 18what is JOIN command,its a function that can be used to combine data from two or more tables by specifying the common field between them
- 19how to use JOINSELECT
FROM
INNER JOIN
ON . =.
(connecting common fields) - 20what is DROP command and how to use itDROP is to delete entire table
DROP table name
Information
- Description
- Highers computing (semester 2) Flashcards on SQL, created by Daniel Nnajiuba on 13/03/2022.
- Created by
- Daniel Nnajiuba
- Views
- 0
- Rating