You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

请指出以下SQL Plus创建飞行员表代码中的错误

Issues in Your Pilots Table Creation SQL

Let's walk through the mistakes in your code clearly:

  • Misspelled constraint keyword: You wrote CONSTRANT instead of CONSTRAINT — you're missing an "A" here. Oracle will throw a syntax error right away because it doesn't recognize this misspelled keyword.
  • Column name typos:
    • pilots_adress is incorrect; it should be pilots_address (you left out a "d" in "address")
    • pilots_zipe is a typo — this should be pilots_zip or pilots_zipcode based on what you need to store
  • Inconsistent data type for phone number: You used varchar(50) for pilots_phone, but in Oracle, the standard and recommended data type for variable-length character data is varchar2. While varchar works for compatibility, Oracle reserves it for future use, so sticking with varchar2 is the better practice.
  • Quick design note (not a syntax error): Using varchar2(50) for your primary key pilots_id is syntactically allowed, but numeric types like NUMBER are usually preferred for primary keys since they're more efficient for storage and indexing.

Here's the fixed version of your SQL code:

CREATE TABLE pilots (
    pilots_id varchar2(50),
    pilots_name varchar2(50),
    pilots_address varchar2(50),
    pilots_city varchar2(50),
    pilots_state varchar2(50),
    pilots_zip varchar2(50),
    pilots_phone varchar2(50),
    CONSTRAINT pilots_pk PRIMARY KEY (pilots_id)
);

内容的提问来源于stack exchange,提问作者Ahmad Maher

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 04:00:50