A comprehensive guide on how to create a database in sql server, including the steps to create tables, insert data, and perform various data manipulation operations. It covers the fundamental concepts of database management, such as data types, data validation, and sql queries. Detailed illustrations and step-by-step instructions, making it a valuable resource for both beginners and experienced users. It covers topics like creating a database, creating tables, inserting data, selecting data, updating data, and deleting data, providing a thorough understanding of sql server database management. Well-structured and easy to follow, making it an excellent reference for students, developers, and it professionals who want to learn or improve their sql server database management skills.
Download SQL Server Database Management: Creating Tables and Inserting Data and more Assignments Database Programming in PDF only on Docsity!
ASSIGNMENT 2 FRONT SHEET
Qualification TEC Level 5 HND Diploma in Computing
Unit number and title Unit 04: Database Design & Development
Submission date Date Received 1st submission
Re-submission Date Date Received 2nd submission
Student Name Nguyễn Đoàn Minh Hiếu Student ID GCD
Class GCD110^4 Assessor name Ho Van Phi
Student declaration
I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand that
making a false declaration is a form of malpractice.
Student’s signature Hieu
Grading grid
P2 P3 P4 P5 M2 M3 M4 M5 D2 D
Summative Feedback: Resubmission Feedback:
Grade: Assessor Signature: Date:
Signature & Date:
I. DEVELOP THE DATABASE SYSTEM
1. Final mock-up of the application
1.1 Introduction
Following assignment 1, all we are familiar with are the ERD designs and diagrams for the database design. We have seen how to
create a database using simple programming tools. database for SQL Server Management. This leads to a clearer understanding of
the database table construction procedure in assignment 2. Both the code that makes the tables and the code that imports data into
the ERD tables will be examined. In order to determine whether the SQLServer Management program is more than just a database
construction tool, we'll look into it further.
1.2 Code to create each table and Code to insert some sample data for each table
To create the student management data table, I use the most basic SQL Server Management Terminology. Among them are
Reservations, Construction, Contracts, Rooms, Staff and Students. I have created a database table with name assignment.
2. Queries to create database with results
2.1. Queries to create database and table
To build the system, we need to create the data first
Figure 1 : Create Database
Figure 4 : Create Table Customers
Figure 5 : Create Table Staff
Figure 6 : Create Table Orders
Figure 7 : Create Table Details
Figure 9 : Diagram
2.2 Data validation
➢ Data types.
INT: It is used to represent an integer value. Its signed range is - 2147483648 to 2147483647, and its unsigned range is 0 to
Figure 10 : : Example Data type int
Date: It is used to specify date format YYYY-MM-DD. Its supported range is from '1000- 01 - 01' to '9999- 12 - 31'.
Figure 11 : Example Data type date
Nvarchar: Variable length, both Unicode and non-Unicode characters, such as Japanese, Korean, and Chinese. It's up to 4,000 characters and
takes up 2 bytes per Unicode/Non-Unicode character
Figure 12 : Example Data type nvarchar
I. DEVELOP THE DATABASE SYSTEM
Final mock-up of the application
1.1 Introduction
Queries to create database with results
2.1. Queries to create database and table
2.2 Data validation
2.3 Querying across multiple tables
II. PRODUCE QUERIES
Queries to INSERT data with illustrations of final result
Queries to SELECT data with illustrations of final result
Queries to UPDATE data with illustrations of final result
Queries to DELETE data with illustrations of final result
III. TEST THE SYSTEM
Test Plan
Test Logs.....................................................................................................................................................................................................................................................
Figure 19: : Insert Information for table Customers
Figure 20: Insert Information for table Product
Figure 21: Insert Information for table Supplier
Figure 22: Insert Information for table Staff
Figure 23: Insert Information for table Orders
Figure 24: : Insert Information for table Details
Figure 25: Select all table
Figure 26: Data table Customers
Figure 27: Data table Details
Figure 28: Data table Orders
Figure 29: Data table Product
Figure 30: Data table Staff
Figure 31: Data table Supplier.................................................................................................................................................................................................................................
Figure 32: Query to update data for Details table
Figure 33: Before change
Figure 34: After change
Figure 35: Query to delete one Staff
Figure 36: Before change
Figure 37: Delete all data in table
Figure 15 : Querying Select
Figure 16 : Data
Figure 17 : Querying Select
Figure 18 : Data
Figure 20 : Insert Information for table Product
Figure 21 : Insert Information for table Supplier
Figure 23 : Insert Information for table Orders
Figure 24 : : Insert Information for table Details
2. Queries to SELECT data with illustrations of final result
➢ After inserting data into the tables, we can check the information by using the Select