0% found this document useful (0 votes)
10 views

Lec2 Lab CSC371 Database Systems

This document discusses how to use Microsoft SQL Server Express Edition to create a database and table, insert data, and run queries. It covers creating a database, using CREATE statements to make tables, the INSERT statement to add records, and the SELECT statement to retrieve data. Examples of SQL syntax are provided for each operation.

Uploaded by

sp22-bse-097
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Lec2 Lab CSC371 Database Systems

This document discusses how to use Microsoft SQL Server Express Edition to create a database and table, insert data, and run queries. It covers creating a database, using CREATE statements to make tables, the INSERT statement to add records, and the SELECT statement to retrieve data. Examples of SQL syntax are provided for each operation.

Uploaded by

sp22-bse-097
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

CSC371-DATABASE SYSTEMS I

(LAB)
PREVIOUS LECTURE REVIEW
• Students should develop a Database System at the end of the term.
• SQL
• DBMS
• Microsoft SQL Server/ MySQL
• How to write a simple query
AGENDA
• Introduction to Microsoft SQL Server Express Edition
• Demonstration: How to write and execute SQL statements
MICROSOFT SQL SERVER EXPRESS
EDITION
• Microsoft SQL Server Management studio
• Database Engine
RESOURCES TO CONSULT AND
PRACTICE
• https://www.w3schools.com/sql/default.asp
• https://www.w3resource.com/sql-exercises/
DATABASE CREATION
• Syntax
• CREATE DATABASE databasename;
• Create database test
SQL CREATE TABLE STATEMENT

• Syntax
• CREATE TABLE table_name (
column1 datatype,
column2 datatype,
column3 datatype,
....
);
• CREATE TABLE Staff (
staffNo int,
fName varchar(255),
lName varchar(255),
position varchar(255),
gender char ,
DOB date,
salary money,
);
SQL INSERT INTO STATEMENT
• Syntax:
• INSERT INTO table_name (column1, column2, column3, ...)
VALUES (value1, value2, value3, ...);

• insert into staff (staffNo, fName, lName , position, gender, DOB, salary)
values(123,'A','B', 'Manager', 'M','11-02-19', 12000)
THE SQL SELECT STATEMENT

• Syntax
• SELECT column1, column2, ...
FROM table_name;

• select staffNo, fName, lName , position, gender, DOB, salary from staff
• Select * from staff
SUMMARY
• How to open and write query.
• How to execute SQL statement.
• How create database.
• How to create table.
• How to insert data record into table.
• How to retrieve data from table.

You might also like