0

I've defined my own database to play around and learn SQL (using SQL*Plus via SSH to remote into my school's linux machines). However, I've been having problems displaying my tables nicely, specifically this one:

CREATE TABLE customer_account 
(
  ACCOUNT_ID NUMBER(10) NOT NULL,
  PHONE_NUMBER VARCHAR(20) NOT NULL,
  EMAIL VARCHAR(100) NOT NULL,
  FNAME VARCHAR(100) NOT NULL,
  LNAME VARCHAR(100) NOT NULL,
  ADDRESS_STREET VARCHAR(50) NOT NULL,
  ADDRESS_CITY VARCHAR(20) NOT NULL,
  ADDRESS_STATE VARCHAR(2) NOT NULL,
  ADDRESS_ZIP VARCHAR(5) NOT NULL,
  BIRTH DATE DEFAULT NULL,
  PRIMARY KEY (ACCOUNT_ID)
);

INSERT INTO customer_account 
VALUES (1, '9174560091', '[email protected]', 'Jack', 'Hunter', '11 67ST', 'New York', 'NY', '10024', TO_DATE('1998/01/22 00:00:00', 'yyyy/mm/dd hh24:mi:ss'));
INSERT INTO customer_account 
VALUES (2, '7134560012', '[email protected]', 'Linda', 'Larson', '100-9 Brooklyn Hwy', 'New York', 'NY', '11225', TO_DATE('1996/12/20 00:00:00', 'yyyy/mm/dd hh24:mi:ss'));
INSERT INTO customer_account 
VALUES (3, '5303056927', '[email protected]', 'Albert', 'Newton', '1206 Francis Mine', 'Sacramento', 'CA', '95814', TO_DATE('2001/05/17 00:00:00', 'yyyy/mm/dd hh24:mi:ss'));
INSERT INTO customer_account 
VALUES (4, '5106204676', '[email protected]', 'Ricky', 'Ricardo', '90 maple street west', 'Trenton', 'NJ', '08861', TO_DATE('1942/12/01 00:00:00', 'yyyy/mm/dd hh24:mi:ss'));
INSERT INTO customer_account 
VALUES (5, '3237843058', '[email protected]', 'Ralph', 'Riggins', '3373 Hillhaven Drive', 'Los Angeles', 'CA', '90017', TO_DATE('1964/10/02 00:00:00', 'yyyy/mm/dd hh24:mi:ss'));
INSERT INTO customer_account 
VALUES (6, '2133384287', '[email protected]', 'Lavonna', 'Williams', '1305 Zimmerman Lane', 'City of Commerce', 'CA', '90040', TO_DATE('1983/03/03 00:00:00', 'yyyy/mm/dd hh24:mi:ss'));
INSERT INTO customer_account 
VALUES (7, '6313604478', '[email protected]', 'Antoinette', 'Reynolds', '2329 Wayback Lane', 'Smithtown', 'NY', '11787', TO_DATE('1990/10/25 00:00:00', 'yyyy/mm/dd hh24:mi:ss'));
INSERT INTO customer_account 
VALUES (8, '9736948587', '[email protected]', 'Berger', 'McDonald', '3024 Spring Haven Trail', 'Mountain View', 'NJ', '07470', TO_DATE('1960/06/17 00:00:00', 'yyyy/mm/dd hh24:mi:ss'));
INSERT INTO customer_account 
VALUES (9, '9082074677', '[email protected]', 'Moe', 'Lester', '2980 Williams Mine Road', 'Lakewood', 'NJ', '08701', TO_DATE('1988/10/05 00:00:00', 'yyyy/mm/dd hh24:mi:ss'));
INSERT INTO customer_account 
VALUES (10, '8282351937', '[email protected]', 'Dam', 'Son', '98 McVaney Road', 'Canton', 'NC', '28716', TO_DATE('1957/08/28 00:00:00', 'yyyy/mm/dd hh24:mi:ss'));

Whenever I did

SQL> SELECT * FROM customer_account;

the entire table does not come out nicely no matter what I tried. I've used set linesize to no avail. This is the best I could do

enter image description here

Is there too much going on per column in the actual table or could I do something to fix this?

4
  • 1
    Please tag database+version and also state your operation system Commented Dec 11, 2016 at 21:49
  • 1
    That looks like SQL*Plus. Is it? Commented Dec 11, 2016 at 22:14
  • 2
    Take a look at the column formatting options for sqlplus. It shows examples. For example column email format a16 to restrict the email column to 16 characters... Commented Dec 11, 2016 at 23:02
  • @Glenn That actually helps solves my problem. Thank you so much for the suggestion. Commented Dec 11, 2016 at 23:16

1 Answer 1

1

I recommend using SQL developer.
Here are 2 suggestions.

Oracle SQL Developer
http://www.oracle.com/technetwork/developer-tools/sql-developer/overview/index-097090.html

SQuirreL SQL
http://squirrel-sql.sourceforge.net/

Sign up to request clarification or add additional context in comments.

2 Comments

I'm currently taking a class on database management and the way we've been learning SQL is via SQL*Plus either using the school's linux machines or using ssh from home to remote into school. Would I be able to integrate one of these IDE's to help me out?
There should no problem to define a connection from your home. If you have any issues, open a question in dba.stackexchange.com

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.