Open the App

Subjects

Computer ScienceComputer Science356 views·Updated 27 Jul 2026·1 page

Ultimate SQL Cheat Sheet for Easy Database Queries

user profile picture
Daniel@zendayasbrother

Ever wondered how websites store and retrieve massive amounts of...

1
of 1
SQL CHEAT SHEET – page 1

N5 SQL Essential Commands

SELECT statements are your go-to tool for finding specific information in a database. You'll need four key components: what fields you want (SELECT), which table to look in (FROM), your search conditions (WHERE), and how to sort results (ORDER BY).

Here's the magic formula: SELECT name, age FROM pupil WHERE age <18 ORDER BY name; This grabs names and ages of pupils under 18, sorted alphabetically. Remember to use speech marks around text values, and you can combine conditions using AND, OR, and NOT.

INSERT statements let you add fresh data to tables. The simplest approach adds values for every field: INSERT INTO Instructor VALUES (5, 'D Thomas', '1985/11/30',5); Just remember that field order matters massively here!

Sometimes you only need to fill certain fields. In that case, specify exactly which ones: INSERT INTO Instructor (InstructorID, Name) VALUES (5, 'D Thomas'); SQL dates follow the yyyy/mm/dd format, so '1985/11/30' means 30th November 1985.

Top Tip: Always double-check your field order when inserting data - getting this wrong is one of the most common SQL mistakes!

DELETE and UPDATE statements handle removing and changing existing data. DELETE works like: DELETE FROM Course WHERE CourseID = 'BMX05'; Be careful though - forget the WHERE clause and you'll delete everything! UPDATE follows this pattern: UPDATE Course SET Date = '2017/12/11' WHERE DATE = '2017/12/10';

EQUI joins connect related tables using matching key fields. This powerful technique lets you pull information from multiple tables simultaneously: SELECT Instructor.Name, Course.Title FROM Instructor, Course WHERE Course.InstructorID = Instructor.InstructorID;

We thought you’d never ask...

Our AI Companion is a student-focused AI tool that offers more than just answers. Built on millions of Knowunity resources, it provides relevant information, personalised study plans, quizzes, and content directly in the chat, adapting to your individual learning journey.

You can download the app from Google Play Store and Apple App Store.

That's right! Enjoy free access to study content, connect with fellow students, and get instant help – all at your fingertips.

Similar content

Most popular content in Computer Science

9
C
Computer ScienceComputer Science

Computer Science quiz

Purpose, Components and functions of CPU. Also von neuman architecture

116394
Computer ScienceComputer Science

GCSE Computer Science Overview

Comprehensive study material for OCR GCSE Computer Science covering key topics such as computer architecture, network security, programming techniques, and ethical considerations. Ideal for exam preparation, this resource includes essential concepts, exam questions, and definitions to enhance understanding and retention.

117,899305
C
Computer ScienceComputer Science

cs ocr

Level up your computer science knowledge with this comprehensive flashcard set designed for grade 11 students. Dive deep into complex concepts and ace your exams!

115280
Computer ScienceComputer Science

GCSE Computer Science Revision

Comprehensive revision notes for OCR GCSE Computer Science Component 1 (J277). Covers key topics including networking, cybersecurity, data compression, computer architecture, and ethical issues. Ideal for exam preparation and understanding core concepts. Access original slides for further details.

114,837150
C
Computer ScienceComputer Science

computer science,geography

this will help you revise for when you are next tested on these questions this will also help you to remember

71971
C
Computer ScienceComputer Science

computing quiz for

good luck

111250
Computer ScienceComputer Science

GCSE Computer Science Algorithms

Comprehensive overview of algorithms for AQA GCSE Computer Science Paper 1, covering key concepts such as sorting (Bubble Sort, Merge Sort), searching (Linear and Binary Search), and essential programming principles like data types, pseudocode, and flowcharts. Ideal for exam preparation and understanding algorithm efficiency.

1175956
Computer ScienceComputer Science

GCSE Computer Science // Revision Notes

Concise revision notes for the GCSE OCR computer science specification (J277). Contains all the info needed for paper 1. Paper 2 is in my bio.

114706
Computer ScienceComputer Science

A-Level Computer Science Paper 1 (Revision sheet)

(Apologies if some things look a bit off, converting the PowerPoint to PDF was a struggle as it wouldn’t let me include my custom drawings for diagrams)

121405

Most popular content

9
SociologySociology

Sociology of Families: Comprehensive Revision

Dive into an extensive overview of family dynamics, perspectives, and patterns in sociology. This resource covers key concepts such as family diversity, gender roles, marriage, and the impact of social policies on family structures. Perfect for A-Level Sociology students preparing for Paper 2.

1273,7922,306
SociologySociology

Sociology of Education Overview

Explore comprehensive A-Level Sociology notes on the education system, covering key theories, policies, and sociological perspectives. This resource includes insights on marketisation, gender roles, cultural deprivation, and educational inequalities, providing a thorough understanding of how education shapes social stratification and individual achievement. Ideal for exam preparation and in-depth study.

12102,9813,040
CriminologyCriminology

Criminology: Crime & Punishment Overview

Comprehensive mindmaps covering key concepts in the Crime and Punishment topic for WJEC Criminology Unit 4. This resource includes detailed insights into the Criminal Justice System, crime prevention strategies, sentencing models, and the roles of various agencies. Ideal for A-Level revision, ensuring you grasp essential theories and legislative processes to excel in your exams.

1254,8981,061
SociologySociology

Comprehensive Crime & Deviance Overview

Explore an extensive revision of crime and deviance topics, including theories, types of crime, and the impact of media. This resource covers key concepts such as Marxism, functionalism, gender and crime, and the influence of globalization on criminal behavior. Ideal for students seeking a thorough understanding of criminology and its various theories. Type: Full Topic Revision.

1251,6701,400
C
BiologyBiology

Cell Biology and Cell structure

cell structures

113,2950
CriminologyCriminology

WJEC Unit 4 Criminology

Criminology unit 4 detailed revision note

127,177125
SociologySociology

Sociological Theories Overview

Comprehensive revision of key sociological theories including Functionalism, Marxism, Feminism, and Interpretivism. Explore concepts like value freedom, identity formation, and the critique of social control. Ideal for AQA A-Level Sociology students preparing for exams. This summary covers essential theories and their implications in sociology, providing a clear understanding of each perspective.

1231,488846
T
BiologyBiology

The functions of subcellular structures - B1 Biology

Flashcards on the different functions of subcellular structures: cell membrane, nucleus, mitochondria, ribosomes, cytoplasm, permant vacuole, chloroplasts and cell wall.

112,8215
1
BiologyBiology

1.cells Gcse biology question cards

combined science higher biology

112,3734

Students love us — and so will you.

4.6/5App Store
4.7/5Google Play

The app is very easy to use and well designed. I have found everything I was looking for so far and have been able to learn a lot from the presentations! I will definitely use the app for a class assignment! And of course it also helps a lot as an inspiration.

Stefan SiOS user

This app is really great. There are so many study notes and help [...]. My problem subject is French, for example, and the app has so many options for help. Thanks to this app, I have improved my French. I would recommend it to anyone.

Samantha KlichAndroid user

Wow, I am really amazed. I just tried the app because I've seen it advertised many times and was absolutely stunned. This app is THE HELP you want for school and above all, it offers so many things, such as workouts and fact sheets, which have been VERY helpful to me personally.

AnnaiOS user

Computer ScienceComputer Science356 views·Updated 27 Jul 2026·1 page

Ultimate SQL Cheat Sheet for Easy Database Queries

user profile picture
Daniel@zendayasbrother

Ever wondered how websites store and retrieve massive amounts of data? SQL (Structured Query Language) is the secret weapon that lets you communicate with databases to find, add, edit, and delete information. Think of it as having a conversation with...

1
of 1
SQL CHEAT SHEET – page 1

Sign up to see the content. It's free!

  • Access to all documents
  • Improve your grades
  • Join milions of students

By signing up you accept Terms of Service and Privacy Policy

N5 SQL Essential Commands

SELECT statements are your go-to tool for finding specific information in a database. You'll need four key components: what fields you want (SELECT), which table to look in (FROM), your search conditions (WHERE), and how to sort results (ORDER BY).

Here's the magic formula: SELECT name, age FROM pupil WHERE age <18 ORDER BY name; This grabs names and ages of pupils under 18, sorted alphabetically. Remember to use speech marks around text values, and you can combine conditions using AND, OR, and NOT.

INSERT statements let you add fresh data to tables. The simplest approach adds values for every field: INSERT INTO Instructor VALUES (5, 'D Thomas', '1985/11/30',5); Just remember that field order matters massively here!

Sometimes you only need to fill certain fields. In that case, specify exactly which ones: INSERT INTO Instructor (InstructorID, Name) VALUES (5, 'D Thomas'); SQL dates follow the yyyy/mm/dd format, so '1985/11/30' means 30th November 1985.

Top Tip: Always double-check your field order when inserting data - getting this wrong is one of the most common SQL mistakes!

DELETE and UPDATE statements handle removing and changing existing data. DELETE works like: DELETE FROM Course WHERE CourseID = 'BMX05'; Be careful though - forget the WHERE clause and you'll delete everything! UPDATE follows this pattern: UPDATE Course SET Date = '2017/12/11' WHERE DATE = '2017/12/10';

EQUI joins connect related tables using matching key fields. This powerful technique lets you pull information from multiple tables simultaneously: SELECT Instructor.Name, Course.Title FROM Instructor, Course WHERE Course.InstructorID = Instructor.InstructorID;

We thought you’d never ask...

Our AI Companion is a student-focused AI tool that offers more than just answers. Built on millions of Knowunity resources, it provides relevant information, personalised study plans, quizzes, and content directly in the chat, adapting to your individual learning journey.

You can download the app from Google Play Store and Apple App Store.

That's right! Enjoy free access to study content, connect with fellow students, and get instant help – all at your fingertips.

Similar content

Most popular content in Computer Science

9
C
Computer ScienceComputer Science

Computer Science quiz

Purpose, Components and functions of CPU. Also von neuman architecture

116394
Computer ScienceComputer Science

GCSE Computer Science Overview

Comprehensive study material for OCR GCSE Computer Science covering key topics such as computer architecture, network security, programming techniques, and ethical considerations. Ideal for exam preparation, this resource includes essential concepts, exam questions, and definitions to enhance understanding and retention.

117,899305
C
Computer ScienceComputer Science

cs ocr

Level up your computer science knowledge with this comprehensive flashcard set designed for grade 11 students. Dive deep into complex concepts and ace your exams!

115280
Computer ScienceComputer Science

GCSE Computer Science Revision

Comprehensive revision notes for OCR GCSE Computer Science Component 1 (J277). Covers key topics including networking, cybersecurity, data compression, computer architecture, and ethical issues. Ideal for exam preparation and understanding core concepts. Access original slides for further details.

114,837150
C
Computer ScienceComputer Science

computer science,geography

this will help you revise for when you are next tested on these questions this will also help you to remember

71971
C
Computer ScienceComputer Science

computing quiz for

good luck

111250
Computer ScienceComputer Science

GCSE Computer Science Algorithms

Comprehensive overview of algorithms for AQA GCSE Computer Science Paper 1, covering key concepts such as sorting (Bubble Sort, Merge Sort), searching (Linear and Binary Search), and essential programming principles like data types, pseudocode, and flowcharts. Ideal for exam preparation and understanding algorithm efficiency.

1175956
Computer ScienceComputer Science

GCSE Computer Science // Revision Notes

Concise revision notes for the GCSE OCR computer science specification (J277). Contains all the info needed for paper 1. Paper 2 is in my bio.

114706
Computer ScienceComputer Science

A-Level Computer Science Paper 1 (Revision sheet)

(Apologies if some things look a bit off, converting the PowerPoint to PDF was a struggle as it wouldn’t let me include my custom drawings for diagrams)

121405

Most popular content

9
SociologySociology

Sociology of Families: Comprehensive Revision

Dive into an extensive overview of family dynamics, perspectives, and patterns in sociology. This resource covers key concepts such as family diversity, gender roles, marriage, and the impact of social policies on family structures. Perfect for A-Level Sociology students preparing for Paper 2.

1273,7922,306
SociologySociology

Sociology of Education Overview

Explore comprehensive A-Level Sociology notes on the education system, covering key theories, policies, and sociological perspectives. This resource includes insights on marketisation, gender roles, cultural deprivation, and educational inequalities, providing a thorough understanding of how education shapes social stratification and individual achievement. Ideal for exam preparation and in-depth study.

12102,9813,040
CriminologyCriminology

Criminology: Crime & Punishment Overview

Comprehensive mindmaps covering key concepts in the Crime and Punishment topic for WJEC Criminology Unit 4. This resource includes detailed insights into the Criminal Justice System, crime prevention strategies, sentencing models, and the roles of various agencies. Ideal for A-Level revision, ensuring you grasp essential theories and legislative processes to excel in your exams.

1254,8981,061
SociologySociology

Comprehensive Crime & Deviance Overview

Explore an extensive revision of crime and deviance topics, including theories, types of crime, and the impact of media. This resource covers key concepts such as Marxism, functionalism, gender and crime, and the influence of globalization on criminal behavior. Ideal for students seeking a thorough understanding of criminology and its various theories. Type: Full Topic Revision.

1251,6701,400
C
BiologyBiology

Cell Biology and Cell structure

cell structures

113,2950
CriminologyCriminology

WJEC Unit 4 Criminology

Criminology unit 4 detailed revision note

127,177125
SociologySociology

Sociological Theories Overview

Comprehensive revision of key sociological theories including Functionalism, Marxism, Feminism, and Interpretivism. Explore concepts like value freedom, identity formation, and the critique of social control. Ideal for AQA A-Level Sociology students preparing for exams. This summary covers essential theories and their implications in sociology, providing a clear understanding of each perspective.

1231,488846
T
BiologyBiology

The functions of subcellular structures - B1 Biology

Flashcards on the different functions of subcellular structures: cell membrane, nucleus, mitochondria, ribosomes, cytoplasm, permant vacuole, chloroplasts and cell wall.

112,8215
1
BiologyBiology

1.cells Gcse biology question cards

combined science higher biology

112,3734

Students love us — and so will you.

4.6/5App Store
4.7/5Google Play

The app is very easy to use and well designed. I have found everything I was looking for so far and have been able to learn a lot from the presentations! I will definitely use the app for a class assignment! And of course it also helps a lot as an inspiration.

Stefan SiOS user

This app is really great. There are so many study notes and help [...]. My problem subject is French, for example, and the app has so many options for help. Thanks to this app, I have improved my French. I would recommend it to anyone.

Samantha KlichAndroid user

Wow, I am really amazed. I just tried the app because I've seen it advertised many times and was absolutely stunned. This app is THE HELP you want for school and above all, it offers so many things, such as workouts and fact sheets, which have been VERY helpful to me personally.

AnnaiOS user