Laboratory Activity 5
Laboratory Activity 5
Screenshot of your database table after each SQL command (Create, Insert, Update,
Delete).
Part 3: Additional Commands and Exiting SQLite
Setting the PATH variable for SQLite allows you to run the SQLite command from any
directory without specifying the full path to the SQLite executable each time. It
simplifies interaction with SQLite databases in the terminal by making SQLite
commands accessible from anywhere. This makes it easier to work with SQLite and
streamline tasks involving SQLite commands, making it more convenient and efficient
to manage your databases.
2. How do you create a table and insert data into it using SQLite?
In creating a table, use the CREATE TABLE commands followed by the table name
and the values to insert. To insert data into the table, we use the INSERT INTO
command followed by the table name and the values to insert.
3. Describe the difference between the UPDATE and DELETE SQL commands.
UPDATE is used to change existing data in a table while DELETE is used to remove
rows from a table.
4. Why is it important to use a primary key (stud_id) in the stud_tbl table?
Using a primary key like stud_id in the stud_tbl table is important because it ensures
that each student has a unique identifier, preventing duplicate records. This makes it
easier to find specific students quickly, as the database can use the stud_id to locate
data efficiency. Additionally, the primary key helps link the grades or attendance,
maintaining accurate and consistent data across the database.