0% found this document useful (0 votes)
11 views2 pages

Museum SQL Queries Explained

This document outlines the SQL commands for creating and managing a museum database system, including tables for exhibitions, artifacts, sensors, staff, and preservation activities. It details commands for altering table structures, dropping tables or databases, truncating records, and renaming tables. The commands provide a comprehensive framework for organizing and maintaining museum-related data.

Uploaded by

vedantkharade05
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views2 pages

Museum SQL Queries Explained

This document outlines the SQL commands for creating and managing a museum database system, including tables for exhibitions, artifacts, sensors, staff, and preservation activities. It details commands for altering table structures, dropping tables or databases, truncating records, and renaming tables. The commands provide a comprehensive framework for organizing and maintaining museum-related data.

Uploaded by

vedantkharade05
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Create Database

Creates a new database for the museum system.

CREATE DATABASE museum_system;


USE museum_system;

Create Exhibition Table

Creates the Exhibition table to store exhibition details.

CREATE TABLE Exhibition (...);


DESC Exhibition;

Create Artifact Table

Stores artifact details and links each artifact to an exhibition.

CREATE TABLE Artifact (...);


DESC Artifact;

Create Sensor Table

Stores sensor details used to monitor artifacts.

CREATE TABLE Sensor (...);


DESC Sensor;

Create Staff Table

Stores museum staff details.

CREATE TABLE Staff (...);


DESC Staff;

Create Preservation Activity Table

Tracks preservation activities performed on artifacts by staff.

CREATE TABLE Preservation_Activity (...);


DESC Preservation_Activity;
ALTER Commands

ALTER commands modify table structure.

ALTER TABLE Exhibition ADD Organizer_Name VARCHAR(50);


ALTER TABLE Artifact MODIFY Condition_Status VARCHAR(50);
ALTER TABLE Sensor CHANGE Status Sensor_Status VARCHAR(30);

DROP Commands

DROP commands delete tables or database permanently.

DROP TABLE Preservation_Activity;


DROP TABLE Sensor;
DROP DATABASE Museum_System;

TRUNCATE Commands

TRUNCATE removes all records but keeps table structure.

TRUNCATE TABLE Exhibition;


TRUNCATE TABLE Preservation_Activity;

RENAME Commands

RENAME changes table names.

RENAME TABLE Artifact TO Museum_Artifact;


RENAME TABLE Staff TO Museum_Staff;

You might also like