In this lesson, you create the Product table and insert sample data in the MobiLink consolidated database.
Prerequisites
This lesson assumes you have completed all preceding lessons. See Lesson 1: Setting up a MobiLink consolidated database.
This lesson assumes that you have the roles and privileges listed in the Privileges section at the start of this tutorial: Tutorial: Introducing MobiLink.
Connect to the consolidated database in Interactive SQL. At a command prompt, run the following command:
You can start Interactive SQL from Sybase Central or at a command prompt.
From Sybase Central, right-click the MLconsolidated - DBA database and click Open Interactive SQL.
dbisql -c "DSN=mlintro_consdb" |
Execute the following SQL statement in Interactive SQL to create the Product table:
CREATE TABLE Product ( name VARCHAR(128) NOT NULL PRIMARY KEY, quantity INTEGER ); |
The Product table contains the following columns:
Column | Description |
---|---|
name |
The name of the product. |
quantity |
The number of items sold. |
After creating the tables, you populate the Product table with sample data.
Execute the following SQL statements in Interactive SQL to populate the Product table with sample data:
INSERT INTO Product(name, quantity) VALUES ( 'Screwmaster Drill', 10); INSERT INTO Product(name, quantity) VALUES ( 'Drywall Screws 10lb', 30); INSERT INTO Product(name, quantity) VALUES ( 'Putty Knife x25', 12); COMMIT; |
Verify that the Product table contains the data inserted from the previous step.
Execute the following SQL statement to verify the contents:
SELECT * FROM Product |
The contents of the Product table should appear in Interactive SQL.
Close Interactive SQL. You do not need to save your SQL statements.
![]() |
Discuss this page in DocCommentXchange.
|
Copyright © 2014, SAP AG or an SAP affiliate company. - SAP Sybase SQL Anywhere 16.0 |