logo

Database Queries

Write a 1500-word individual report on Database Development, focusing on the use of Structured Query Language (SQL) for managing data held in a relational database management system (RDBMS). The report should be submitted via Turnitin on Moodle as a Word file.

15 Pages2102 Words407 Views
   

Added on  2023-04-21

About This Document

This document provides a comprehensive guide on database queries, covering topics such as Structure Query Language (SQL), Data Manipulation, Data Control Language, and Database Testing. It explains the purpose and syntax of various SQL commands, such as CREATE and ALTER, and discusses the importance of database testing. The document also includes sample queries and examples for reference.

Database Queries

Write a 1500-word individual report on Database Development, focusing on the use of Structured Query Language (SQL) for managing data held in a relational database management system (RDBMS). The report should be submitted via Turnitin on Moodle as a Word file.

   Added on 2023-04-21

ShareRelated Documents
Running head: DATABASE QUERIES
Database Queries
Name of the Student:
Name of the University:
Author Note
Database Queries_1
1
DATABASE QUERIES
Table of Contents
Task 1: Structure Query Language (SQL).................................................................................2
Data Definition Language......................................................................................................2
Data Control Language..........................................................................................................3
Task 2: Data Manipulation.........................................................................................................4
Query 2...................................................................................................................................5
Query 3...................................................................................................................................5
Query 4...................................................................................................................................6
Query 5...................................................................................................................................6
Query 6...................................................................................................................................7
Query 7...................................................................................................................................7
Query 8...................................................................................................................................8
Query 9...................................................................................................................................9
Query 10...............................................................................................................................10
Task 3: Database Testing.........................................................................................................11
Task 4: Referencing and Bibliography....................................................................................16
Database Queries_2
2
DATABASE QUERIES
Task 1: Structure Query Language (SQL)
Data Definition Language
The main purpose behind using data definition language is that it helps in defining the
data structure that is used for modifying the data within the SQL. This is having a predefined
syntax that is used with the aim of discussing the need of data. The two commands that are
used in DDL are create and alter. The create command is used with the aim of creating a new
database or for creating a new table. This includes the functions related to the table, views
and triggers. On the other hand ALTER command is used for the purpose of altering the
structure of the database. The SQL is used for the purpose of collecting the imperative verbs
that focuses on modifying the schema based on the database by deleting the modifying
elements within the database and also offers adding elements within the database.
CREATE command: CREATE command is used for creating a component within the
relational database management system. The components that are related to creation of a
database elements includes views, assertions and tables and many more. The data types that
are offered in the table includes int, double, float, varchar, date and text. The main aim
behind using the create command is that it is used at the time of creating database within a
relational database management system. The syntax for create command is as follows:
CREATE DATABASE <DB_NAME>;
In order to create a table, the syntax used is as follows:
CREATE TABLE <TABLE_NAME>
{
Column_name1 datatype1.
Column_name2 datatype2,
Database Queries_3
3
DATABASE QUERIES
};
ALTER command: the command is used for making changes within the already existing table
structure. The functions associated with this includes adding up of a column to the already
existing table, renaming the already existing column, includes changing data within the
database. This also offers modifying the size of the table and also allows the user to drop the
columns from the chosen table. ALTER command is used with the purpose of changing the
properties within the relational database management system. The changes that are allowed to
be altered mainly depends on RDBMS. The syntax that is used for the ALTER Command are
as follows:
ALTER TABLE table_name ADD (
Column_name datatype);
In order to add multiple new columns the syntax used are as follows:
ALTER TABLE table_name ADD (
column_name1 datatype1,
Column-name2 datatype2,
column-name3 datatype3);
For adding column with the use of a default value:
ALTER TABLE table_name ADD (
Column-name1 datatype1 DEFAULT some_value
);
Database Queries_4

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Database Queries
|22
|2302
|116

Database Management System
|14
|2029
|235

Data Modelling & SQL Language : Assignment
|21
|2425
|31

SQL: DDL Create and Alter, DCL Grant and Revoke, Data Manipulation, Database Testing
|13
|2239
|63

Structured Query Language - PDF
|9
|1603
|187

Data Modelling in Database Design
|8
|1351
|159