Newer
Older
labs / tiddlers / content / labs / lab03 / _Labs_03_Test your connection.md
Before we start the task for today we will test that we have our set-up correct.

1.	Write a simple create table statement:

	```sql
	CREATE TABLE Test(
		UserName varchar(10)
	);
	```

2.	<<keys "Control > Enter">> will run the statement, or use the <<menu {{$:/ou/clipart/dbeaver/dbeaver_exec_sql}}>> button on the left side of the editor pane.

3.	Right click on the gutter between the editor and execute buttons and check the <<menu "□ Show Line Numbers">> box --- this can be helpful to find errors.

4.	Check the Navigator window to see if it created OK.

	You will probably need to drill into your schema to find the tables:
	
	<<menu "comp101 > Databases > Schemas > your username >  Tables">>.

	You probably won't see the `Test` table since the Navigator pane does not automatically refresh --- you need to manually do this.   Right click on the <<menu "Tables">> and select  <<menu "🗘 Refresh">>.

	You should see the `Test` table now.

6.	Try inserting some data:

	```sql
	INSERT INTO Test (UserName) VALUES ('doris');
	```
	Use <<keys "Control > Enter">> to run the insert statament.

7.	Now we can test that it worked by interrogating the database with a `SELECT` statement:

	```sql
	SELECT * FROM Test;
	```
	to check it is there.

8.	Test completed. Clear out the the `Test` table and we are ready to start work.

	```sql
	DROP TABLE Test;
	```